# the fifth day of wyq
for x in range(1,11):
    y = x * x
    print(y)
L = []
for j in range(0,12):
    L.append(j * j)
    print(L)
#使用内建的isinstance函数判断变量是不是一个字符串
a = 'Acb'
b = 123
isinstance(a,str)
isinstance(b,str)
#迭代
P = [2,4,7,6,5,8,9,0,3,1]
def findMinAndMax(P):
    return (None, None)
# 进行测试.
if findMinAndMax([]) != (None, None):
    print('测试失败!')
elif findMinAndMax([7]) != (7, 7):
    print('测试失败!')
elif findMinAndMax([7, 1]) != (1, 7):
    print('测试失败!')
elif findMinAndMax([7, 1, 3, 9, 5]) != (1, 9):
    print('测试失败!')
else:
    print('测试成功!')
Accounters = ['Alice','Bob','Cindy','Dave','Eric','Frank','Helen']
choose = int(input("今天是星期几？： "))
#这里总是爱忘记转义f
for ter in Accounters:
    if choose <= 5:
        print(f"Hello, {ter}. Would you like to see a status report?")
    elif choose < 8:
        print(f"Hi,{ter}! Thanks for your logging again, have a nice day.")
    else:
        print(f"Oh, dear{ter},it's doesn't leaving this day, humrous are you and have good time for you.")
#字典1243我着实写的是备忘录没别的意思啊~;
alien_0 = {'color': 'green','point': 5}
print(alien_0['color'])
print(alien_0['point'])
import random
for c in range(0,3):
    mx0 = int(input("请输入x的位置： "))
    ny2 = int(input("请输入y滴位置： "))
    sz5 = input("请你正确地选择小外星人的移动速度（slow/medium/fast）： ")
    alien_0 = {f'x_position': mx0, 'y_position': ny2,'speed':sz5}
    print(f"Original position: {alien_0['x_position']}")
    # 向右移动外星人。
    # 然后再根据当前速度确定将外星人向右移动多远。
    if alien_0['speed'] =='slow':
           x_increment = 1
    elif alien_0['speed'] =='medium':
         x_increment = 2
    else:
        x_increment = 3
     # 新位置为旧位置加上移动距离。
    alien_0['x_position'] = alien_0['x_position'] + x_increment
    print(f"New position: {alien_0['x_position']}")
print("All right to come on up.")
    
